import random

lst = sorted([random.randint(1, 100) for i in range(100)])
print(lst)

def func(lst,value):
    min=0
    max=len(lst)-1
    while min<=max:
        m=(min+max)//2
        if lst[m]==value:
            return m
        elif lst[m]<value:
            min=m+1
        elif lst[m]>value:
            max=m-1
    return -1
a = func(lst,47)



